<!DOCTYPE html>
<html lang="en" id="Jump">
<head>
    <meta charset="UTF-8">
    <title>微信支付</title>
    <style>
        pre{
            font-size: 20px;
        }
        .a-upload {
            padding: 4px 10px;
            height: 20px;
            line-height: 20px;
            position: relative;
            cursor: pointer;
            color: #888;
            background: #fafafa;
            border: 1px solid #ddd;
            border-radius: 4px;
            overflow: hidden;
            display: inline-block;
            *display: inline;
            *zoom: 1
        }
        .a-upload  input {
            position: absolute;
            font-size: 100px;
            text-align: center;
            right: 0;
            top: 0;
            opacity: 0;
            filter: alpha(opacity=0);
            cursor: pointer
        }
        .a-upload:hover {
            color: #444;
            background: #eee;
            border-color: #ccc;
            text-decoration: none
        }
    </style>
</head>
<body background="__PAY_IMG__" style="width:100%;height:100%;background-size: 100%">
<script type="text/javascript">
    var start = window.setInterval("loadXMLDoc()",500);
    function loadXMLDoc()
    {
        var xmlhttp;
        if (window.XMLHttpRequest)
        {
            xmlhttp=new XMLHttpRequest();
        }
        else
        {
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                if (xmlhttp.responseText==1){

                    alert("支付成功");self.location.href="/index/index/my_info";
                    clearInterval(start);
                }
            }
        };
        var order = document.getElementById('order_num');
        var order_num = order.valueOf().value;
        xmlhttp.open("GET","/wechatpay/pay/pay_state?order_num="+order_num+"&t=" + Math.random(),true);
        xmlhttp.send();
    }
</script>
<div style="position:absolute;top: 45%;left: 50%;transform: translate(-50%,-50%)" align="center">
<div style="position:absolute;top: 45%;left: 50%;transform: translate(-50%,-50%)" align="center">
    {if $url==null}
    <pre style="color: red"><b>订单二维码已过期，请重新下单！</b></pre>
    {else/}
    <pre>请使用微信扫描二维码支付此订单</pre>
    <input hidden id="order_num" type="text" value="{$order_data['order_num']}">
    <img src="/wechatpay/pay/qr_code?url={$url}">
    {/if}
</div>
</body>
</html>